package com.maggroup.conference_system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.maggroup.conference_system.entity.Meeting;
import com.maggroup.conference_system.repositories.MeetingRepository;
import com.maggroup.conference_system.service.MeetingService;

@Service
public class MeetingServiceImpl implements MeetingService {

	@Autowired
	private MeetingRepository meetingRepository;

	@Override
	public List<Meeting> getMeetingList() {
		return meetingRepository.findAll();
	}

	@Override
	public Meeting addMeeting(Meeting meeting) {
		return meetingRepository.save(meeting);
	}

	@Override
	public Meeting getOne(Integer id) {
		return meetingRepository.findById(id).get();
	}

}
